<?php
/*
	我的足迹
*/
defined('BY_JYA') or exit('error');
$_RQ['op']=$_RQ['op']?$_RQ['op']:'main';
if($_RQ['op']=='main'){
	$return['setting']=$this->plugin_setting('basic');
	$return['list']=array();
	set_html('title','接力记录');
	exi($return);
}
// js 获取数据
if($_RQ['op']=='getlist'){
	$params=array(
		'uniacid'=>$_SESSION['uniacid'],'help_mid'=>$_SESSION['uid']
	);
	if(trim($_RQ['keywords'])){
		$params['title like']='%'.trim($_RQ['keywords']).'%';
	}
	//进一步整理筛选条件，商品属性字段是否需 要调整，商品分类如何筛选，orderby如何整理
	$pindex = max(1, intval($_RQ['page']));
	$psize = 20;
	if($_RQ['num']){
		$psize=$_RQ['num'];
	}
	$total='';
	$orderby='id desc';
	$list=pdo_getslice('jy_yousetli_help',$params,array($pindex,$psize),$total,$fields,'',$orderby);
	if($list){
		foreach($list as &$item){
			$act=pdo_get('jy_yousetli_act',array('uniacid'=>$_SESSION['uniacid'],'id'=>$item['actid']),array('title'));
			$item=array_merge($item,$act);
			$item['createtime']=date('Y-m-d',$item['createtime']);
			$item['xiangqing']=str_array($item['xiangqing']);
		}
	}
	$return['list']=$list;
	exi($return);
}